//
//  JHSDoctorListModel.m
//  JHSSweep
//  申请名医
//  Created by Apple on 2017/3/23.
//  Copyright © 2017年 JHDS. All rights reserved.
//

#import "JHSDoctorListModel.h"
#import "JHSNetworkTool.h"
#import <YYModel.h>

@implementation JHSDoctorListModel

-(void)setValue:(id)value forKey:(NSString *)key{

}

+(void)getDoctorListDataWithURLString:(NSString *)URLString andParameters:(NSDictionary *)parameters andSuccessBlock:(void(^)(NSArray *newsList))successBlock andErrorBlock:(void(^)(NSError *error))errorBlock{

    [[JHSNetworkTool shareManager] postWithURLStr:URLString withParameters:parameters withSuccessBlock:^(id responseBody) {
        
        // 解析json数据
        //获取需要的字典数组
        NSArray *dictArr = responseBody[@"data"];
        // 使用YYModel把字典数组转模型数组
        NSArray *newsList = [NSArray yy_modelArrayWithClass:[JHSDoctorListModel class] json:dictArr];
        if (successBlock) {
            successBlock(newsList);
        }
        
    } withFailureBlock:^(NSError *error) {
        if (errorBlock) {
            errorBlock(error);
        }
        
    }];
}


@end
